home *** CD-ROM | disk | FTP | other *** search
- /* $Id: I3DExRft.h 1.17 1997/06/24 17:43:19 Logan Exp $ */
-
- /*****************************************************************************\
- * *
- * I3DXRFtr.h *
- * Render feature definition *
- * *
- * Copyright (c) 1996, Fractal Design Corp. All rights reserved. *
- * *
- \*****************************************************************************/
-
- #ifndef __I3DEXRFT__
- #define __I3DEXRFT__
-
- #ifndef __3DCOTYPE__
- #include "3DCoType.h"
- #endif
-
- #ifndef __ISH3DFIL__
- #include "ISh3DFil.h"
- #endif
-
- #ifndef __I3DEX__
- #include "I3DEx.h"
- #endif
-
- #ifndef __I3DSHUTI__
- #include "I3DShUti.h"
- #endif
-
- #ifndef __I3DSHAB__
- #include "I3DSHAB.H"
- #endif
-
- struct I3DShGroup;
- struct I3DShLightsource;
-
-
- struct IllumSettings {
- short fShadowsOn;
- short fReflectionOn;
- short fTransparencyOn;
- short fLightThroughTransp;
- short fBumpOn;
- short fRefractionOn;
- long fMaxRayDepth;
- };
-
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExIllumModel, 0x817684AA, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
-
- #undef INTERFACE
- #define INTERFACE I3DExIllumModel
-
- struct RTLevelInfo {
- NUM3D ratio;
- short ref;
- short trans;
- short action;
- short reserved;
- };
-
-
-
- DECLARE_INTERFACE_(I3DExIllumModel, IUnknown) {
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // IID_I3DExIllumModel methods
- STDMETHOD(LightBeam) (THIS_ const Ray3D &aR,I3DShInstance *self,
- NUM3D tmin,NUM3D tmax,COLOR3D &filterColor, unsigned long& numberOfRays) PURE;
- STDMETHOD(GetRayColor) (THIS_ const RayHitParameters ¶ms,
- const VECTOR2D theScreenUV,
- const Ray3D &theray,const RTLevelInfo &level,
- COLOR3D &resColor, ShadingOut &shadingOut,
- RayHit3D &hit, unsigned long& numberOfRays, NUM3D* maskResult);
- };
-
-
-
-
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExRenderFeature, 0x817684A5, 0x8B35, 0x11D0, 0xA5, 0x04A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
- typedef struct RendFtrCommonIn {
- VECTOR3D fInGPos;
-
- }RendFtrCommonIn;
-
-
- #undef INTERFACE
- #define INTERFACE I3DExRenderFeature
-
-
- DECLARE_INTERFACE_(I3DExRenderFeature, I3DExDataExchanger) {
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // I3DExtension methods
- STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
- STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
-
- // I3DExDataExchanger methods
- STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE; // Return NULL if GetResID is to be used
- STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
- STDMETHOD(ExtensionDataChanged) (THIS) PURE;
- STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
- STDMETHOD_(short, GetResID) (THIS) PURE;
-
- // I3DExRenderFeature methods
- STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
- };
-
-
-
- #if 0
- //this will become a separate interface
- STDMETHOD_(BOOLEAN, TakesFacetStream) (THIS) PURE;
- STDMETHOD(FacetStreamInit) (THIS) PURE;
- STDMETHOD(FacetStreamFeed) (THIS) PURE; //xxx add facet param
- STDMETHOD(FacetStreamEnd) (THIS) PURE;
- #endif
-
-
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExAbufAccessor, 0x817684AC, 0x8B35, 0x11D0, 0xA5, 0x04A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
- #undef INTERFACE
- #define INTERFACE I3DExAbufAccessor
-
- DECLARE_INTERFACE_(I3DExAbufAccessor, IUnknown) {
-
- //fragment access
- STDMETHOD_(void*, GetNthFrag) (THIS_ long h, long v, long N) PURE;
-
- //privdata access
- STDMETHOD_(void*, GetPrivData)(THIS_ void* voidFrag, unsigned long token);
-
- //fragment attribute access
- STDMETHOD(GetWeight)(THIS_ void* voidFrag, unsigned long& theWeight);
- STDMETHOD(GetI3DShInstance)(THIS_ void* voidFrag, I3DShInstance*& theI3DShInstance);
- STDMETHOD(GetUVSpaceID)(THIS_ void* voidFrag, unsigned long& theUVSpaceID);
- STDMETHOD(GetZ)(THIS_ void* voidFrag, QuickFix& theZ);
- STDMETHOD(GetGNormal)(THIS_ void* voidFrag, VECTOR3D& theNormal);
- STDMETHOD(GetGPosition)(THIS_ void* voidFrag, VECTOR3D& thePosition);
-
- //xxx add other accessors: mask bits, local normal, local position, uv, etc
- };
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExShadowFeature, 0x817684A6, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
- #undef INTERFACE
- #define INTERFACE I3DExShadowFeature
-
- typedef struct {
- I3DShGroup* fTree;
- I3DShEnvironment* fBackground;
- I3DShEnvironment* fBackdrop;
- I3DShEnvironment* fAtmosphere;
- COLOR3D fAmbient;
- BOX2D fuvMinMax;
- }
- RendEnv;
-
-
- typedef struct ShadowIOParms {
- unsigned long fValidFlags;
- IllumSettings fIllumSettings;
- unsigned long fNumberOfRays;
-
- //IN REQUIRED
- I3DExIllumModel* fIllumModel;
- I3DShLightsource* fLight;
- const VECTOR3D* fGPosIn;
- const ShadingOut* fShading;
- const VECTOR3D* fEyeDD;
- RendEnv fRendEnv; //(const)
- const VECTOR3D* fHitNormIn;
- VECTOR3D* fReflectDir;
- float fBias;
-
- VECTOR3D fLightDir;
- NUM3D fDistToLight;
- COLOR3D fLightColor;
- Boolean fCallForShadowEffect;
-
- //IN OPTIONAL
- const Ray3D* fRayIn;
- I3DShInstance* fI3DShInstance; //where the illumination is falling
- const VECTOR3D* fRealN;
-
- //firsthit stuff
- Boolean fIsFirstHit;
- I3DExAbufAccessor* fAbufAccess;
- VECTOR2D fScreenUV;
-
- //OUT REQUIRED
- COLOR3D* fResColor;
- COLOR3D* fSpecColor;
-
- }ShadowIOParms;
-
-
-
- DECLARE_INTERFACE_(I3DExShadowFeature, I3DExRenderFeature) {
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // I3DExtension methods
- STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
- STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
-
- // I3DExDataExchanger methods
- STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE; // Return NULL if GetResID is to be used
- STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
- STDMETHOD(ExtensionDataChanged) (THIS) PURE;
- STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
- STDMETHOD_(short, GetResID) (THIS) PURE;
-
- // I3DExRenderFeature methods
- STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
-
- // I3DExShadowFeature methods
- STDMETHOD(GetShadowNeedFlags) (THIS_ unsigned long& needFlags) PURE;
- STDMETHOD(CalcShadow) (THIS_ ShadowIOParms& theFIOParms) PURE;
- };
-
-
-
-
-
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExAbuf1stHit, 0x817684AB, 0x8B35, 0x11D0, 0xA5, 0x04A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
- #undef INTERFACE
- #define INTERFACE I3DExAbuf1stHit
-
- DECLARE_INTERFACE_(I3DExAbuf1stHit, IUnknown) {
- STDMETHOD_(ULONG, GetBoxFiltWidth) (THIS) PURE;
- STDMETHOD_(ULONG, GetPrivDataSize) (THIS) PURE;
- STDMETHOD(SetToken) (THIS_ unsigned long token) PURE;
- STDMETHOD(SetUpPrivData) (THIS_ long h, long v,
- I3DExAbufAccessor* theAccessor, void* privData) PURE;
- STDMETHOD(ClosePrivData) (THIS_ void* privData) PURE;
- };
-
-
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExReflectionFeature, 0x817684A7, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
- #undef INTERFACE
- #define INTERFACE I3DExReflectionFeature
-
-
- typedef struct ReflectionIOParms {
- unsigned long fValidFlags;
- IllumSettings fIllumSettings;
- unsigned long fNumberOfRays;
-
- //RendFtrCommonIn fInCommon;
-
- I3DExIllumModel* fIllumModel;
- RTLevelInfo fRTLevInfo;
- RendEnv fRendEnv; //(const)
- Boolean fGotFlectColor;
- I3DShInstance* fI3DShInstance;
- VECTOR2D fScreenUV;
- const VECTOR3D* fGPosIn;
- const ShadingOut* fShading;
- VECTOR3D* fReflectDir;
- const Ray3D* fRayToSplit;
- QuickFix fRayT;
-
- COLOR3D flectResColor;
-
- } ReflectionIOParms;
-
-
-
- DECLARE_INTERFACE_(I3DExReflectionFeature, I3DExRenderFeature) {
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // I3DExtension methods
- STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
- STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
-
- // I3DExDataExchanger methods
- STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE; // Return NULL if GetResID is to be used
- STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
- STDMETHOD(ExtensionDataChanged) (THIS) PURE;
- STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
- STDMETHOD_(short, GetResID) (THIS) PURE;
-
- // I3DExRenderFeature methods
- STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
-
- // I3DExReflectionFeature methods
- STDMETHOD(GetReflectionNeedFlags) (THIS_ unsigned long& needFlags) PURE;
- STDMETHOD(CalcReflection) (THIS_ ReflectionIOParms& theFIOParms) PURE;
- };
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExRefractionFeature, 0x817684A8, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
- #undef INTERFACE
- #define INTERFACE I3DExRefractionFeature
-
- typedef struct RefractionIOParms {
- unsigned long fValidFlags;
- IllumSettings fIllumSettings;
- unsigned long fNumberOfRays;
-
- //RendFtrCommonIn fInCommon;
-
- const VECTOR3D* fGPosIn;
- const ShadingOut* fShading;
- const Ray3D* fRayToSplit;
- RTLevelInfo fRTLevInfo;
- NUM3D fGrayT;
- QuickFix fRayT;
- VECTOR3D* fNormal;
- I3DExIllumModel* fIllumModel;
- RendEnv fRendEnv; //(const)
- I3DShInstance* fI3DShInstance;
- VECTOR3D* fReflectDir;
- Boolean fNormalFlipped;
-
- //firsthit stuff
- Boolean fIsFirstHit; //xxx
- I3DExAbufAccessor* fAbufAccess;
- VECTOR2D fScreenUV;
-
- //OUT
- Boolean fGotFractColor;
- NUM3D fMask;
- COLOR3D fFractResColor;
- } RefractionIOParms;
-
-
-
- DECLARE_INTERFACE_(I3DExRefractionFeature, I3DExRenderFeature) {
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // I3DExtension methods
- STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
- STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
-
- // I3DExDataExchanger methods
- STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE; // Return NULL if GetResID is to be used
- STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
- STDMETHOD(ExtensionDataChanged) (THIS) PURE;
- STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
- STDMETHOD_(short, GetResID) (THIS) PURE;
-
- // I3DExRenderFeature methods
- STDMETHOD(FrameJuncture) (THIS_ I3DShInstance* theInstance, Boolean moreFrames) PURE;
-
- // I3DExRefractionFeature methods
- STDMETHOD(GetRefractionNeedFlags) (THIS_ unsigned long& needFlags) PURE;
- STDMETHOD(CalcRefraction) (THIS_ RefractionIOParms& theFIOParms) PURE;
- };
-
-
- //****** Globally Unique Id **************************************************
- //mirrored in CDEFS.H
- DEFINE_GUID(IID_I3DExGenericData, 0x817684A9, 0x8B35, 0x11D0, 0xA5, 0x4A, 0x00, 0xAA, 0x00, 0xA3, 0x63, 0x75);
-
-
- #undef INTERFACE
- #define INTERFACE I3DExGenericData
-
-
- DECLARE_INTERFACE_(I3DExGenericData, I3DExDataExchanger) {
- // IUnknown methods
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
-
- // I3DExtension methods
- STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
- STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
-
- // I3DExDataExchanger methods
- STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE; // Return NULL if GetResID is to be used
- STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
- STDMETHOD(ExtensionDataChanged) (THIS) PURE;
- STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
- STDMETHOD_(short, GetResID) (THIS) PURE;
-
- // I3DExGenericData methods
- };
-
-
- //Private data for attachability list (stored in the 'Cmpp' resource of same ID)
- #define kVariableLengthArray 1
- typedef struct {
- unsigned long fNumAttaches;
- unsigned long fAttachType[kVariableLengthArray];
- } ExAttachData;
-
-
-
-
-
- #endif
-
-
-